import request from '@/utils/request'
import { DeptConfig, DeptConfigSearch, DeptList } from '@/model/business/questions/deptconfig/model'

export function getAllDeptList (data: DeptConfigSearch) {
  return request<DeptList>({
    url: '/deptConfig/getOrganizesList',
    data: data,
    method: 'post'
  })
}

export function removeDeptConfig (id: string) {
  return request({
    url: `/deptConfig/remove?id=${id}`,
    method: 'post'
  })
}

export function getNextShowOrder () {
  return request<number>({
    url: '/deptConfig/getMaxOrder',
    method: 'get'
  })
}

export function getDeptConfigById (id: string) {
  return request<DeptConfig>({
    url: `/deptConfig/getOrganizeById?id=${id}`
  })
}

export function saveDeptConfig (data: DeptConfig) {
  return request({
    url: '/deptConfig/save',
    data: data,
    method: 'post'
  })
}
